{extend name="public/base"/}
{block name="main"}
<script type="text/javascript" src="__LIBS__/layer/layer.js"></script>
	<h1>环境检测</h1>

	<table class="table table-hover table-bordered">
		<caption><h2>运行环境检查</h2></caption>
		<thead>
			<tr>
				<th>项目</th>
				<th>所需配置</th>
				<th>当前配置</th>
			</tr>
		</thead>
		<tbody>
			{volist name="env" id="item"}
				<tr>
					<td>{$item[0]}</td>
					<td>{$item[1]}</td>
					<td><span class="badge {$item[4]}">{$item[3]}</span></td>       
				</tr>
			{/volist}
		</tbody>
	</table>
	{present name="dirfile"}
	<table class="table table-hover table-bordered">
		<caption><h2>目录、文件权限检查</h2></caption>
		<thead>
			<tr>
				<th>目录/文件</th>
				<th>所需状态</th>
				<th>当前状态</th>
			</tr>
		</thead>
		<tbody>
			{volist name="dirfile" id="item"}
				<tr>
					<td>{$item[3]}</td>
					<td>可写</td>
					<td><span class="badge {$item[2]}">{$item[1]}</span></td>
				</tr>
			{/volist}
		</tbody>
	</table>
	{/present}
	<table class="table table-hover table-bordered">
		<caption><h2>函数依赖性检查</h2></caption>
		<thead>
			<tr>
				<th>函数名称</th>
				<th>检查结果</th>
			</tr>
		</thead>
		<tbody>
			{volist name="func" id="item"}
				<tr>
					<td>{$item[0]}()</td>
					<td><span class="badge {$item[2]}">{$item[1]}</span></td>
				</tr>
			{/volist}
		</tbody>
	</table>
	<div class="margin-top">
		<div class="text-center">
		    <a class="btn btn-primary ajax-post" href="javascript:void(0);">下一步</a>
		    <a class="btn btn-default" href="{:url('install/index/index')}">上一步</a>
		</div>
	</div>
	<script type="text/javascript">
		$(function(){
			$(".ajax-post").click(function(){
				$.post("{:url('install/index/check')}",function(result){
					if(result.code==1){
						window.location.href=result.url
					}else{
						 layer.msg(result.msg, {shift: 6});
					}
				})
			})
		});
	</script>

{/block}